import request from '@/utils/request'

//查看门禁
export function getApiAccessPageList(params) {
  return request({
    url: '/api/app/access/access-pagelist',
    method: 'get',
    params
  })
}
//新增门禁
export function insertApiAccess(data) {
  return request({
    url: '/api/app/access/save-access',
    method: 'post',
    data
  })
}
//修改门禁
export function updataApiAccess(data) {
  return request({
    url: '/api/app/access/edit-access',
    method: 'post',
    data
  })
}
//删除门禁
export function deleteApiAccess(id)
{
  return request({
    url: `/api/app/access/${id}/access`,
    method: 'delete',
  })
}
//添加权限时选择进或者出的门禁
export function getApiAccessDirection(params)
{
  return request({
    url: '/api/app/access/direction-list',
    method: 'get',
    params 
  })
}
/**
 * 外接设备中的设备信息
 * @param {*} params 
 * @returns 
 */
export function getIotDevice(params)
{
  return request({
    url: '/iot-os/api/app/device/search-list',
    method: 'get',
    params 
  })
}

export function getIotIdDevice(id)
{
  return request({
    url: `/iot-os/api/app/device/${id}`,
    method: 'get',
  })
}

